﻿<%@ Page Title="" Language="C#" MasterPageFile="~/shrh.Master" AutoEventWireup="true"
    CodeBehind="ProductInfo_rh2.aspx.cs" Inherits="WebApp.Product.ProductInfo_rh2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <script language="javascript" type="text/javascript">

     function tabChange(obj, id) {
         var arrayli = obj.parentNode.getElementsByTagName("li"); //获取li数组
         var arrayul = document.getElementById(id).getElementsByTagName("ul"); //获取ul数组
         for (i = 0; i < arrayul.length; i++) {
             if (obj == arrayli[i]) {
                 arrayli[i].className = "cli";
                 arrayul[i].className = "";
             }
             else {
                 arrayli[i].className = "";
                 arrayul[i].className = "hidden";
             }
         }
     }

     function getEventObject(W3CEvent) {			//事件标准化函数
         return W3CEvent || window.event;
     }


     function getPointerPosition(e) {			//兼容浏览器的鼠标x,y获得函数
         e = e || getEventObject(e);
         var x = e.pageX || (e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft));
         var y = e.pageY || (e.clientY + (document.documentElement.scrollTop || document.body.scrollTop));

         return { 'x': x, 'y': y };
     }

     function setOpacity(elem, level) {			//兼容浏览器设置透明值
         if (elem.filters) {
             elem.style.filter = 'alpha(opacity=' + level * 100 + ')';
         } else {
             elem.style.opacity = level;
         }
     }

     function css(elem, prop) {				//css设置函数,可以方便设置css值,并且兼容设置透明值
         for (var i in prop) {
             if (i == 'opacity') {
                 setOpacity(elem, prop[i]);
             } else {
                 elem.style[i] = prop[i];
             }
         }
         return elem;
     }

     var magnifier = {
         m: null,

         init: function (magni) {
             var m = this.m = magni || {
                 cont: null, 	//装载原始图像的div
                 img: null, 		//放大的图像
                 mag: null, 		//放大框
                 scale: 14			//比例值,设置的值越大放大越大,但是这里有个问题就是如果不可以整除时,会产生些很小的白边,目前不知道如何解决
             }

             css(m.img, {
                 'position': 'absolute',
                 'width': (m.cont.clientWidth * m.scale) + 'px', 			//原始图像的宽*比例值	
                 'height': (m.cont.clientHeight * m.scale) + 'px'				//原始图像的高*比例值
             })

             css(m.mag, {
                 'display': 'none',
                 'width': m.cont.clientWidth + 200 + 'px', 		//m.cont为原始图像,与原始图像等宽
                 'height': m.cont.clientHeight + 200 + 'px',
                 'overflow': 'hidden',
                 'position': 'absolute',
                 'left': m.cont.offsetLeft + m.cont.offsetWidth + 10 + 'px', 	//放大框的位置为原始图像的右方远10px
                 'top': m.cont.offsetTop + 'px'
             })

             var borderWid = m.cont.getElementsByTagName('div')[0].offsetWidth - m.cont.getElementsByTagName('div')[0].clientWidth; 	//获取border的宽

             css(m.cont.getElementsByTagName('div')[0], {			//m.cont.getElementsByTagName('div')[0]为浏览框
                 'display': 'none', 							//开始设置为不可见
                 'width': m.cont.clientWidth / m.scale - borderWid + 'px', 		//原始图片的宽/比例值 - border的宽度
                 'height': m.cont.clientHeight / m.scale - borderWid + 'px', 	//原始图片的高/比例值 - border的宽度
                 'opacity': 0.5					//设置透明度
             })

             m.img.src = m.cont.getElementsByTagName('img')[0].src; 		//让原始图像的src值给予放大图像
             m.cont.style.cursor = 'crosshair';

             m.cont.onmouseover = magnifier.start;

         },

         start: function (e) {

             if (document.all) {				//只在IE下执行,主要避免IE6的select无法覆盖
                 magnifier.createIframe(magnifier.m.img);
             }

             this.onmousemove = magnifier.move; 	//this指向m.cont
             this.onmouseout = magnifier.end;
         },

         move: function (e) {
             var pos = getPointerPosition(e); 	//事件标准化

             this.getElementsByTagName('div')[0].style.display = '';

             css(this.getElementsByTagName('div')[0], {
                 'top': Math.min(Math.max(pos.y - this.offsetTop - parseInt(this.getElementsByTagName('div')[0].style.height) / 2, 0), this.clientHeight - this.getElementsByTagName('div')[0].offsetHeight) + 'px',
                 'left': Math.min(Math.max(pos.x - this.offsetLeft - parseInt(this.getElementsByTagName('div')[0].style.width) / 2, 0), this.clientWidth - this.getElementsByTagName('div')[0].offsetWidth) + 'px'			//left=鼠标x - this.offsetLeft - 浏览框宽/2,Math.max和Math.min让浏览框不会超出图像
             })

             magnifier.m.mag.style.display = '';

             css(magnifier.m.img, {
                 'top': -(parseInt(this.getElementsByTagName('div')[0].style.top) * magnifier.m.scale) + 'px',
                 'left': -(parseInt(this.getElementsByTagName('div')[0].style.left) * magnifier.m.scale) + 'px'
             })

         },

         end: function (e) {
             this.getElementsByTagName('div')[0].style.display = 'none';
             magnifier.removeIframe(magnifier.m.img); 	//销毁iframe

             magnifier.m.mag.style.display = 'none';
         },

         createIframe: function (elem) {
             var layer = document.createElement('iframe');
             layer.tabIndex = '-1';
             layer.src = 'javascript:false;';
             elem.parentNode.appendChild(layer);

             layer.style.width = elem.offsetWidth + 'px';
             layer.style.height = elem.offsetHeight + 'px';
         },

         removeIframe: function (elem) {
             var layers = elem.parentNode.getElementsByTagName('iframe');
             while (layers.length > 0) {
                 layers[0].parentNode.removeChild(layers[0]);
             }
         }
     }

     window.onload = function () {
         magnifier.init({
             cont: document.getElementById('magnifier'),
             img: document.getElementById('magnifierImg'),
             mag: document.getElementById('mag'),
             scale: 5
         });
     }

     function askPrice() {
         window.alert("请拨打公司的服务热线：400-6676-996进行询价！");
     }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="weizhi">
        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/ProductSupCategory.htm">所有分类</asp:HyperLink>
        &nbsp;&nbsp;&gt;
        <asp:HyperLink ID="HLTopCategory" runat="server">[HLTopCategory]</asp:HyperLink>
        &nbsp;&nbsp;&gt;
        <asp:HyperLink ID="HLSecondCategory" runat="server">[HLSecondCategory]</asp:HyperLink>
        &nbsp;&nbsp;&gt;<asp:HyperLink ID="HLThirdCategory"
            runat="server">[HLThirdCategory]</asp:HyperLink>
        &gt;<span><asp:Literal ID="LtName" runat="server"></asp:Literal></span>
    </div>
    <div class="pr4_show">
        <div class="pr4_show1">
            <div id="magnifier">
                <img id="img" runat="server" src="~/Product/imgs/sunre04.jpg" />
                <div id="Browser">
                </div>
            </div>
            <div id="mag">
                <img id="magnifierImg" /></div>
        </div>
        <div class="pr4_show2">
            <h2>
                <asp:Literal ID="Literal1" runat="server" Text="康庄 Baby sound b 爱贝音超生多普勒带薪亿"></asp:Literal>
            </h2>
            <p>
                编号：<asp:Literal ID="Literal2" runat="server"></asp:Literal></p>
            <div class="p4s_1">
                评级：<img src="../image/start.gif" /><a href="">(共<asp:Literal ID="txtCommonNum" runat="server"></asp:Literal>条评论)</a></div>
            <div class="p4s_list">
                <p>
                    市 &nbsp;&nbsp;&nbsp;场 &nbsp;&nbsp;&nbsp;价： <span class="p42">￥<asp:Literal ID="Literal3"
                        runat="server"></asp:Literal></span></p>
                <p>
                    日花优惠价：
                    <%--<input type="Button" id="Literal4ask" value="询价" name="txtAsk" onclick="askPrice()"
                        runat="server" />--%>
                    <span class="p43">
                        <asp:Literal ID="Literal4" runat="server"></asp:Literal></span></p>
            </div>
            <div class="p4s_list2">
                <ul>
                    <li>配送限制：无限制 </li>
                    <li>提&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;示：本商品为特惠商品，仅限普通客户购买，只提供普通发票，不提供增值税发票。</li>
                    <li>邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费：买家承担</li>
                    <li>购买数量：<asp:TextBox ID="txtQuantity" Width="50px" Text="1" runat="server"></asp:TextBox>
                        件</li>
                    <li class="p4s_button">
                        <asp:ImageButton ID="ImageButton1" ImageUrl="../image/shopping2.gif" runat="server"
                            OnClick="ImageButton1_Click" />
                        &nbsp;&nbsp;&nbsp;
                        <asp:ImageButton ID="ImageButton2" ImageUrl="../image/shoucangtianjia.jpg" runat="server"
                            OnClick="ImageButton2_Click" />
                        <span id="AskPrice" runat="server" visible="false" class="p4l1"><a href="#" onclick="askPrice()">
                            我要咨询</a>
                            <%--<input type="Button" id="Button1" value="我要咨询" name="txtAsk" onclick="askPrice()"
                        runat="server" />--%>
                            <%-- <asp:LinkButton ID="linkBtn" runat="server" onclick="linkBtn_Click">我要咨询</asp:LinkButton>--%></span>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="pr5_pingl">
        <p class="pr5_zxbt">
            输入您的评论内容</p>
        <div class="pr5_1">
            <label>
                <asp:TextBox TextMode="MultiLine" Width="750px" Height="150px" ID="txtCommentContent" runat="server"></asp:TextBox>
                
            </label>
        </div>
        <p>
            <asp:ImageButton ID="btnSbmit" ImageUrl="~/image/tijiao.gif" runat="server" 
                onclick="btnSbmit_Click" />
        </p>
    </div>
</asp:Content>
